
import java.math.BigInteger;

public class e015 {
    public static void main(String[] args) {
        long sTime = System.currentTimeMillis();
        long n = numPaths(20, 20);
        System.out.println(n);
        long fTime = System.currentTimeMillis();
        System.out.println("Time: " + (fTime - sTime) + "ms");
    }

    static long numPaths(int i, int i1) {
        int j = i + i1;
        BigInteger e = new BigInteger(String.valueOf(j));
        BigInteger f1 = new BigInteger(String.valueOf(i));
        BigInteger f2 = new BigInteger(String.valueOf(i1));
        long n = Long.parseLong(String.valueOf(factorial(e).divide(factorial(f1).multiply(factorial(f2)))));
        return n;
    }

    static BigInteger factorial(BigInteger e) {
        int i = Integer.valueOf(String.valueOf(e));
        for (int j = i - 1; j > 0; j--) {
            BigInteger n = new BigInteger(String.valueOf(j));
            e = e.multiply(n);
        }
        return e;
    }
}